package com.example.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * TODO
 *
 * @author ding
 * @since 2024/6/13
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("department")
public class Department {
    @TableId(type = IdType.AUTO)
    private Integer id;
    /** 部门名称 */
    private String name;
    /** 关联项目id */
    private Integer projectId;
    /** 部门人数 */
    private Integer num;
    /** 部门创建时间 */
    private LocalDate setTime;
    private Integer isDeleted;
    /** 关联项目名称 */
    @TableField(exist = false)
    private String projectName;

    /** 乐观锁版本号 */
    @ApiModelProperty("乐观锁版本号")
    @Version
    @TableField(value = "version", fill = FieldFill.INSERT)
    private Integer version;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
